package com.curso.session9;

public class Singleton {

	private	int v ;
	private static Singleton name;

	private Singleton(int v){
		this.v = v;
	}

	public static Singleton getInstance(int v) {
		if (name == null) {
			name = new Singleton(v);
		} else {
			name.v = v;	
		}
		return name;
	}

	@Override
	public String toString() {
		return "Singleton [v=" + v + "]";
	}
}
